/**
 * thread demo
 */
package cn.netjava.softkid.chapter09;

/**
 * @author softkid
 *
 */
public class ThreadDemo extends Thread{

	/**
	 * constructor method
	 */
	private Thread t;
	public ThreadDemo() 
	{
		
		t= Thread.currentThread();
	}
	public void run()
	{
		for(int i=0;i<5;i++)
		{
			try {
				t.setName("xxx"+i);
				t.sleep(2000);
				System.out.println("sssssssssssss"+t.getName());
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
